package com.emcom.gotour.mvc.view;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.context.MessageSource;

import com.emcom.gotour.mvc.message.TourMessage;

public class TourContentView implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3055446122991076749L;
	private String id;
	private String typeName;
	private String category;
	private String subject;
	private String aim;
	private String characteristic;
	private String location;
	private String days;
	private String cost;
	private String costComments;
	private String costStandard;
	private String costNotice;
	private String attention;
	private String statement;
	private String comments;
	private String isAd;
	private String adImageUrl;
	private String isImage;
	private String imageUrl;
	public TourContentView() {
	}
	public TourContentView(HttpServletRequest request, MessageSource messageSource) {
		this.id = TourMessage.ID.value(request, messageSource);
		this.typeName = TourMessage.TypeName.value(request, messageSource);
		this.category = TourMessage.Category.value(request, messageSource);
		this.subject = TourMessage.Subject.value(request, messageSource);
		this.aim = TourMessage.Aim.value(request, messageSource);
		this.characteristic = TourMessage.Characteristic.value(request, messageSource);
		this.location = TourMessage.Location.value(request, messageSource);
		this.days = TourMessage.Days.value(request, messageSource);
		this.cost = TourMessage.Cost.value(request, messageSource);
		this.costComments = TourMessage.CostComments.value(request, messageSource);
		this.costStandard = TourMessage.CostStandard.value(request, messageSource);
		this.costNotice = TourMessage.CostNotice.value(request, messageSource);
		this.attention = TourMessage.Attention.value(request, messageSource);
		this.statement = TourMessage.Statement.value(request, messageSource);
		this.comments = TourMessage.Comments.value(request, messageSource);
		this.isAd = TourMessage.IsAd.value(request, messageSource);
		this.adImageUrl = TourMessage.AdImageUrl.value(request, messageSource);
		this.isImage = TourMessage.IsImage.value(request, messageSource);
		this.imageUrl = TourMessage.ImageUrl.value(request, messageSource);
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTypeName() {
		return typeName;
	}
	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getAim() {
		return aim;
	}
	public void setAim(String aim) {
		this.aim = aim;
	}
	public String getCharacteristic() {
		return characteristic;
	}
	public void setCharacteristic(String characteristic) {
		this.characteristic = characteristic;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getDays() {
		return days;
	}
	public void setDays(String days) {
		this.days = days;
	}
	public String getCost() {
		return cost;
	}
	public void setCost(String cost) {
		this.cost = cost;
	}
	public String getCostComments() {
		return costComments;
	}
	public void setCostComments(String costComments) {
		this.costComments = costComments;
	}
	public String getCostStandard() {
		return costStandard;
	}
	public void setCostStandard(String costStandard) {
		this.costStandard = costStandard;
	}
	public String getCostNotice() {
		return costNotice;
	}
	public void setCostNotice(String costNotice) {
		this.costNotice = costNotice;
	}
	public String getAttention() {
		return attention;
	}
	public void setAttention(String attention) {
		this.attention = attention;
	}
	public String getStatement() {
		return statement;
	}
	public void setStatement(String statement) {
		this.statement = statement;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getIsAd() {
		return isAd;
	}
	public void setIsAd(String isAd) {
		this.isAd = isAd;
	}
	public String getAdImageUrl() {
		return adImageUrl;
	}
	public void setAdImageUrl(String adImageUrl) {
		this.adImageUrl = adImageUrl;
	}
	public String getIsImage() {
		return isImage;
	}
	public void setIsImage(String isImage) {
		this.isImage = isImage;
	}
	public String getImageUrl() {
		return imageUrl;
	}
	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		TourContentView myClass = (TourContentView) object;
		return new CompareToBuilder().append(this.costStandard,
				myClass.costStandard).append(this.costNotice,
				myClass.costNotice).append(this.imageUrl, myClass.imageUrl)
				.append(this.isAd, myClass.isAd).append(this.location,
						myClass.location).append(this.subject, myClass.subject)
				.append(this.isImage, myClass.isImage).append(this.adImageUrl,
						myClass.adImageUrl).append(this.cost, myClass.cost)
				.append(this.costComments, myClass.costComments).append(
						this.statement, myClass.statement).append(this.id,
						myClass.id).append(this.typeName, myClass.typeName)
				.append(this.category, myClass.category).append(this.days,
						myClass.days).append(this.aim, myClass.aim).append(
						this.characteristic, myClass.characteristic).append(
						this.attention, myClass.attention).append(
						this.comments, myClass.comments).toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof TourContentView)) {
			return false;
		}
		TourContentView rhs = (TourContentView) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.costStandard, rhs.costStandard).append(this.costNotice,
				rhs.costNotice).append(this.imageUrl, rhs.imageUrl).append(
				this.isAd, rhs.isAd).append(this.location, rhs.location)
				.append(this.subject, rhs.subject).append(this.isImage,
						rhs.isImage).append(this.adImageUrl, rhs.adImageUrl)
				.append(this.cost, rhs.cost).append(this.costComments,
						rhs.costComments).append(this.statement, rhs.statement)
				.append(this.id, rhs.id).append(this.typeName, rhs.typeName)
				.append(this.category, rhs.category)
				.append(this.days, rhs.days).append(this.aim, rhs.aim).append(
						this.characteristic, rhs.characteristic).append(
						this.attention, rhs.attention).append(this.comments,
						rhs.comments).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(207746099, -1887522133).appendSuper(
				super.hashCode()).append(this.costStandard).append(
				this.costNotice).append(this.imageUrl).append(this.isAd)
				.append(this.location).append(this.subject)
				.append(this.isImage).append(this.adImageUrl).append(this.cost)
				.append(this.costComments).append(this.statement).append(
						this.id).append(this.typeName).append(this.category)
				.append(this.days).append(this.aim).append(this.characteristic)
				.append(this.attention).append(this.comments).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("isAd", this.isAd).append(
				"adImageUrl", this.adImageUrl)
				.append("comments", this.comments).append("subject",
						this.subject).append("typeName", this.typeName).append(
						"statement", this.statement).append("attention",
						this.attention).append("location", this.location)
				.append("imageUrl", this.imageUrl).append("category",
						this.category).append("characteristic",
						this.characteristic).append("cost", this.cost).append(
						"isImage", this.isImage).append("days", this.days)
				.append("costNotice", this.costNotice).append("aim", this.aim)
				.append("costComments", this.costComments)
				.append("id", this.id)
				.append("costStandard", this.costStandard).toString();
	}
}
